package com.masz.lcnpay;

import com.masz.lcnpay.mapper.TbPay;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.web.bind.annotation.*;

@RestController
@RequestMapping("/lcnpay")
public class TestController {

    @Autowired
    PayService payService;

    @Value("${server.port}")
    private String port;

    @GetMapping("/test")
    public String test(){
        return "lanpay-test:"+port;
    }


    @PostMapping("/pay")
    public String pay(@RequestBody TbPay pay){
        payService.pay(pay.getPayName());
        return "lanpay-test:"+port;
    }

    @PostMapping("/payTcc")
    public String tccPay(@RequestBody TbPay pay){
        payService.payTcc(pay.getPayName());
        return "lanpay-test:"+port;
    }


}
